<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<%--<% response.sendRedirect("goindex.action"); %>
--%>
<html>
	<head>
		<title>流媒体视频管理平台-系统登录</title>
		<SCRIPT type="text/javascript" src="js/jquery-1.5.1.min.js"></SCRIPT>
		<SCRIPT type="text/javascript" src="js/jquery-ui.js"></SCRIPT>
		<link rel="stylesheet" href="css/site.css" type="text/css"></link>
		<link rel="stylesheet" href="js/jquery-ui-1.8.17.custom.css"
			type="text/css"></link>
		<SCRIPT type="text/javascript">
			
	$(document).ready(function(){$("#username").focus();});
	function login() {
		if ($("#username").val() == "" || $("#password").val() == "") {
			alert("请输入用户名和密码");
			return;
		}
		var params = {
			"username" : $("#username").val(),
			"password" : $("#password").val()
		};
		$("#waitProgress").dialog(
				{
					height:120,
					width:290,
					resizable:false,
					modal:true,
					title:""
				});
		$.ajax( {
			url : "myLogin.action",
			data : params,
			dataType : "json",
			cache:false,
			success : function(data) {
				if (data == "") {
					alert("用户名或密码错误");
					$("#username").focus();
				} else {
					window.location(data);
				}
				$("#waitProgress").dialog('close');
			},
			error : function(ee) {
				$("#waitProgress").dialog('close');
				alert("登录时发生错误");
			}
		});
	}
</SCRIPT>
	</head>
	<body class="loginBody" id="login">
		<center>
			<s:actionerror id="actionError" />
		</center>
		用户名:&nbsp;&nbsp;
		<input id="username" type="text" name="admin.name" class="textbox" />
		<br />
		<br />
		<span style="width: 300px">密&nbsp;&nbsp;码:</span>&nbsp;&nbsp;
		<input id="password" type="password" name="admin.pwd" class="textbox" />
		<br />
		<br />
		<br />
		<input type="button" onclick="login()" value="登录" class="button" />

		<br />
		<br />
		<div style="text-align: center; margin: auto;">
			<a href="Register.jsp" style="text-decoration: none; color: White">客户端注册</a>
		</div>
		<br />
	</body>

	<div id="waitProgress" style="display: none">
		数据加载中...........
	</div>
</html>